# -*- encoding: utf-8 -*-
str1 = "hello world ha ha "
print(str.split(" "))   #分割
print(str1.split(" ", 2))   #如果字符串有指定值，则仅分割maxsplit个子字符串

my_str = "hello world difanjiaoyu and difanjiaoyuPython"
print(my_str.partition("difanjiaoyu"))   #mystr以str分成三部分，str前，str和str后
print(my_str.rpartition("difanjiaoyu"))    #  类似于partition方法  不过是从右边开始


st = 'hello\nworld'
print(st)
print(st.splitlines())   #  按照行分割


li = ["My","name","is","ayan"]   #合并
ss = " "
sss = "_"
print(ss.join(li))
print(ss.join(li))